// 待处理邀请
import { navigation } from '../../../../utils/commons'

Page({

    data: {
        idOfPrg: '',
        msgId: ''
    },

    onLoad(options) {
        console.log("invitation");
        this.setData({
            idOfPrg: options.idOfPrg,
            msgId: options.msgId
        });

        wx.request({
            url: 'https://www.hschuangsai.com/recruitProject/info?projectId=' + this.data.idOfPrg,
            method: "GET",
            success: (res) => {
                let project = res.data.data.recruitProject;
                this.setData({
                    membersOfPrg: res.data.data.members,
                    briefDemand: project.briefDemand,
                    captainName: project.captainName,
                    demand: project.demand,
                    endTime: project.endTime,
                    institute: project.institute,
                    introduction: project.introduction,
                    name: project.name,
                    planEndTime: project.planEndTime,
                    planStartTime: project.planStartTime,
                    recruitNum: project.recruitNum,
                    startTime: project.startTime,
                    teacherApartment: project.teacherApartment,
                    teacherName: project.teacherName,
                    teacherRank: project.teacherRank,
                    status: project.status
                })
            }
        })
    },

    gotoAccept() {
        navigation('../invitation/accept/accept?name=' + this.data.name + '&id=' + this.data.idOfPrg + '&msgId=' + this.data.msgId);
    },

    gotoReason() {
        console.log('invitation msgId', this.data.msgId);
        navigation('../invitation/reason/reason?name=' + this.data.name + '&id=' + this.data.idOfPrg + '&msgId=' + this.data.msgId);
    }
})

